import { NgModule } from '@angular/core';
import { RouterModule, Routes } from '@angular/router';
import { LayoutDefaultComponent } from './layout/default/default.component';
import { Exception403Component } from './routes/exception/403.component';
import { Exception404Component } from './routes/exception/404.component';
import { Exception500Component } from './routes/exception/500.component';
import { environment } from 'src/environments/environment';

const routes: Routes = [
  {
    path: '',
    component: LayoutDefaultComponent,
    children: [
      { path: '', redirectTo: 'music/home', pathMatch: 'full' },
      { path: 'home', redirectTo: 'music/home', pathMatch: 'full' },
      {
        path: 'music',
        loadChildren: () => import('./routes/routes.module').then(m => m.RoutesModule)
      },
    ]
  },
  { path: '403', component: Exception403Component },
  { path: '404', component: Exception404Component },
  { path: '500', component: Exception500Component },
  { path: '**', redirectTo: '404' }
];

@NgModule({
  imports: [RouterModule.forRoot(routes, {useHash: environment.useHash})],
  exports: [RouterModule]
})
export class AppRoutingModule { }
